package com.su.song.shapapplication.util;

import android.app.Activity;
import android.content.Context;
import android.hardware.input.InputManager;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class ViewUtil {
    public static void HideInputMethod(Activity act, View v){
        //从系统服务中获取软件盘输入法
        InputMethodManager imm = (InputMethodManager) act.getSystemService(Context.INPUT_METHOD_SERVICE);
        //关闭软件盘输入法,通过那个令牌找到活动的那个窗口
        imm.hideSoftInputFromWindow(v.getWindowToken(),0);
    }
}
